package com.atguigu.wordcount.flowbean;

import org.apache.hadoop.io.WritableComparable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

/**
 * @ClassName FlowBean
 * @DeScription FlowBean
 * @Author 剧情再美终是戏
 * @Date 2019/11/18 17:02
 * @Version 1.0
 **/
public class FlowBean implements WritableComparable {

    private long uploadSum;

    private long downSum;

    private long total;

    public FlowBean() {
    }

    public int compareTo(Object o) {
        return 0;
    }

    public void write(DataOutput out) throws IOException {
        out.writeLong(uploadSum);
        out.writeLong(downSum);
        out.writeLong(total);
    }

    public void readFields(DataInput in) throws IOException {
        uploadSum = in.readLong();
        downSum = in.readLong();
        total = in.readLong();
    }

    public long getUploadSum() {
        return uploadSum;
    }

    public void setUploadSum(long uploadSum) {
        this.uploadSum = uploadSum;
    }

    public long getDownSum() {
        return downSum;
    }

    public void setDownSum(long downSum) {
        this.downSum = downSum;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    @Override
    public String toString() {
        return uploadSum + "\t" + downSum + "\t" + total;
    }
}
